package com.example.foo.wanquanpay.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.core.PageResult;
import com.example.core.Pageable;
import com.example.foo.wanquanpay.model.WanquanPayLog;
import com.example.foo.wanquanpay.query.WanquanPayLogQuery;
import org.apache.commons.lang3.StringUtils;

@org.apache.ibatis.annotations.Mapper
public interface WanquanPayLogDao extends com.example.core.dao.BaseDao<WanquanPayLog, Long>{

    public default PageResult<WanquanPayLog> findWanquanPayLogs(WanquanPayLogQuery wanquanPayLogQuery, Pageable pageable) {
        QueryWrapper<WanquanPayLog> queryWrapper = createQueryWithBaseIf(wanquanPayLogQuery);
        //
        if (StringUtils.isNotEmpty(wanquanPayLogQuery.getApi())) {
            queryWrapper.like("api", wanquanPayLogQuery.getApi());
        }
        return findPages(queryWrapper, pageable);
    }

}
